local function addTarget(t, callback)
  target(t)
    set_targetdir("../bin")
    add_includedirs("..")
    add_packages("SDL2","SDL2_image","SDL2_ttf","SDL2_mixer")
    set_kind("binary")
    add_files(t .. "/**.cc")
    if callback then callback() end
  target_end()
end

local function useOpenGL()
  if is_os("windows") then
    add_links("OpenGL32")
  else
    add_links("OpenGL")
  end
end

addTarget("wrapper")
addTarget("driver")
addTarget("window")
addTarget("opengl", function()
  useOpenGL()
end)